package cn.com.sbell.vss.csg.vsclient.ipcamera;

import java.io.IOException;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;

import cn.com.sbell.vss.VssConstants;
import cn.com.sbell.vss.VssException;

public class ControlPtzThread extends Thread {
	private int statusCode;
	private HttpMethod method;
	private HttpClient client;
	public ControlPtzThread(HttpMethod method, HttpClient client) {
		super();
		this.method = method;
		this.client = client;
	}
	public void run() {
		
		super.run();
		executeMethod(method);
		
		
	}
	private void executeMethod(HttpMethod method) {
		try {
			statusCode = client.executeMethod(method);
		} catch (IOException e) {
			throw new VssException(VssConstants.CODE_VISIT_NVS_ERROR);
		} finally {
			method.releaseConnection();
		}
	}
	public int getStatusCode() {
		return statusCode;
	}
	
	
}
